

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>注册 - WoniuHis</title>
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/login.css" media="all"></head>
  <script src="../../js/vue.js"></script>  <!-- vue追加 -->
  <script src="../../js/axios.min.js"></script>		<!-- vue的AJAX追加 -->

<body>
<br/><br/><br/><br/>
    
<div class="layadmin-user-login-box layadmin-user-login-header" align="center" id="Register">
        <h2>WoniuHis</h2>
        <p>注册</p>
        <br/><br/>	       	   
 	       	   
  	    <div class="layui-input-inline">  	    	
    		 <input type="text" v-model="userName"  placeholder="请输入用户名" autocomplete="off" class="layui-input">
   		</div><br/><br/>
  		<div class="layui-input-inline">
     	 	<input type="password" v-model="userPassword" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
    	</div> <br/><br/>   
    	<div class="layui-input-inline">
     		 <input type="password" v-model="rePassword" required lay-verify="required" placeholder="请确认密码密码" autocomplete="off" class="layui-input">
    	</div> <br/><br/> 
    	
    	<span>已有账号去</span><a href="./login.html" style="color: #FFA500">登录</a><br/>   	   	
   		<input type="button" @click="userReg" class="layui-btn" value="注册"></input>
  		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
 
  </div>
<script>
var Register=new Vue({
		el:"#Register",
		
		data:{
			userName:"",
			userPassword:"",
			rePassword:""
		},
		
		methods:{
			userReg:function(){
				axios.get(
					"http://localhost:8080/register",{
						params:{
							userName:this.userName,
							userPassword:this.userPassword,
							rePassword:this.rePassword
						}
					}
				).then(data=>{					
					alert(data.data.msg);
				}).catch(err=>{
					alert(err.data.msg);
				})
			},
			
		}
		
		
	})
</script>

</body>
</html>